<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<script language="javaScript" type="text/javascript"
	src="<c:url value='/cal/calendar.js'/>" >
</script>

<link href="<c:url value='/cal/calendar.css'/>" rel="stylesheet" type="text/css">
<link href="<c:url value='/Styles/style.css'/>" rel="stylesheet" type="text/css" />

</head>
<body>
	<div class="page">
		<div id="header-wrapper">
			<div id="header">
				<div id="logo">
					<h4>ADMIN</h4>
				</div>
			</div>
		</div>

		<div class="page-wrapper">
			<div class="main">
				<div class="colleft">
					<div class="col1">
						<h4><%@ include file="admin-logout.jsp"%></h4>
						<h4><%@ include file="admin-menu.jsp"%></h4>
					</div>
					<div class="col2">
						<h1>
							<u
								style="FONT-FAMILY: 'Candara'; BACKGROUND-COLOR: #8080ff; COLOR: #000000;">Leave
								Application Processing System</u>
						</h1>
						<h2>Position Manager</h2>
<!-- Calender Script  -->

						<table id="calenderTable">
							<tbody id="calenderTableHead">
								<tr>
									<td colspan="4" align="center"><select
										onChange="showCalenderBody(createCalender(document.getElementById('selectYear').value,
	           							this.selectedIndex, false));"
										id="selectMonth">
											<option value="0">Jan</option>
											<option value="1">Feb</option>
											<option value="2">Mar</option>
											<option value="3">Apr</option>
											<option value="4">May</option>
											<option value="5">Jun</option>
											<option value="6">Jul</option>
											<option value="7">Aug</option>
											<option value="8">Sep</option>
											<option value="9">Oct</option>
											<option value="10">Nov</option>
											<option value="11">Dec</option>
									</select></td>
									<td colspan="2" align="center"><select
										onChange="showCalenderBody(createCalender(this.value, 
										document.getElementById('selectMonth').selectedIndex, false));"
										id="selectYear">
									</select></td>
									<td align="center"><a href="#" onClick="closeCalender();"><font
											color="#003333" size="+1">X</font>
									</a></td>
								</tr>
							</tbody>
							<tbody id="calenderTableDays">
								<tr style="">
									<td>Sun</td>
									<td>Mon</td>
									<td>Tue</td>
									<td>Wed</td>
									<td>Thu</td>
									<td>Fri</td>
									<td>Sat</td>
								</tr>
							</tbody>
							<tbody id="calender"></tbody>
						</table>

<!-- End Calender Script  -->
						<c:if test="${state != 'initupdate'}">
						<form action="publicholiday" method="get">
							<table>
								<tr>
									<td><input name="action" value="add" type="hidden"></td>
								</tr>
								<tr>
									<td>ID</td>
									<td><input name="id" readonly="readonly">
									</td>
								</tr>
								<tr>
									<td>DATE</td>
									<td><input name="date">
									<a
										href="#"
										onClick="setYears(2005, 2012);
       									showCalender(this, 'date');">									
											<img src="http://www.villamundo.net/img/casamundo/icons/calendar.png" alt="cal" width="20" height="20">
									</a>
									</td>
								</tr>
								<tr>
									<td>DESCRIPTION</td>
									<td><input name="des">
									</td>
								</tr>
								<tr>
									<td colspan=2><input type="submit" value="Add Holiday">
									</td>
								</tr>
							</table>
						</form>
						</c:if>
						<c:if test="${state == 'initupdate'}">
						<form action="publicholiday" method="get">
							<table>
								<tr>
									<td><input name="action" value="update" type="hidden"></td>
								</tr>
								<tr>
									<td>ID</td>
									<td><input name="id" readonly="readonly" value='${id}'>
									</td>
								</tr>
								<tr>
									<td>DATE</td>
									<td><input name="date" value='${date}'>
									<a
										href="#"
										onClick="setYears(2005, 2012);
       									showCalender(this, 'date');">									
											<img src="http://www.villamundo.net/img/casamundo/icons/calendar.png" alt="cal" width="20" height="20">
									</a>
									</td>
								</tr>
								<tr>
									<td>DESCRIPTION</td>
									<td><input name="des" value='${des}'>
									</td>
								</tr>
								<tr>
									<td colspan=2><input type="submit" value="Update Holiday">
									</td>
								</tr>
							</table>
						</form>
						</c:if>	
						<h4>
							<c:out value="${msg}" />
						</h4>

						<c:if test="${state != 'initupdate'}">
							<table id="add" border="1">
								<c:forEach var="pos" items="${posList}">
									<tr>
										<td><c:out value="${pos.id}" />
										</td>
										<td><c:out value="${pos.date}" />
										</td>
										<td><c:out value="${pos.description}" />
										</td>																		
										<td>
										<a href="
										<c:url value='/admin/publicholiday'>
											<c:param name='action' value='initupdate' />
											<c:param name='id' value='${pos.id}' />
										</c:url>
										">update</a>
										</td>
										<td>
										<a href="
										<c:url value='/admin/publicholiday'>
											<c:param name='action' value='delete' />
											<c:param name='id' value='${pos.id}' />
										</c:url>
										">delete</a>
										</td>
									</tr>
								</c:forEach>
								<h4>
									<c:out value="${msg1}" />
								</h4>
							</table>
						</c:if>	
						
					</div>
					<!-- end col2 -->

				</div>
				<!-- end colleft -->

			</div>
			<!-- end main -->

		</div>
		<!-- end page-wrapper -->

	</div>
	<!-- end page -->

</body>
</html>